/*
 * Copyright (c) 2023, Cshoo affiliates. All rights reserved.
 */

package org.cshoo.sf.price;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @author 杨翼
 * @version 1.0
 * @since 1.0
 */
public class DiscountStrategy extends GeneralStrategy {

    public static final String STRAWBERRY = "strawberry";

    @Override
    public BigDecimal gainUnitPrice(String fruit) {
        BigDecimal superUnitPrice = super.gainUnitPrice(fruit);
        if (Objects.equals(fruit, STRAWBERRY)) {
            return superUnitPrice.multiply(new BigDecimal("0.8"));
        }
        return superUnitPrice;
    }

}
